{% extends "Themes/Itdashu/templates/page.twig" %}

{% block body %}

    <div class="col-lg-9 col-md-9 left-box">
        {{ content() }}
        <article class="node">
            <div class="header">
                <h1 class="title">
                    <a href="{{ url(['for':'node','contentModel':node.nodeContentModel,'id':node.getId()]) }}">{{ node.title }}的评论</a>
                </h1>
            </div>
            <div class="body">
                内容简介：{% if node.description is defined AND node.description %}{{ node.description }}{% else %}{{ subString(node.body,250,true) }}{% endif %}
            </div>
        </article>

        <div class="content comment">

            {% if commentForm %}
                {{ view.r(commentForm) }}
            {% else %}
                <div class="no-access-comment">
                    {% if user.isLogin() is false %}
                        请<a class="highlight" href="{{ url(['for':'login']) }}" ajax-model="{{ url(['for':'login']) }}">登录</a>后评论
                    {% else %}
                        宝宝没有权限评论哦
                    {% endif %}
                </div>
            {% endif %}

            {{ view.r(['#templates':'commentList','#module':'comment','data':data]) }}
            {{ partial("Themes/Itdashu/templates/paginator") }}
        </div>
        {% do assets.addCss('comment','/modules/comment/css/style.css','footer') %}
        {% do assets.addJs('jquery.form','http://cdn.bootcss.com/jquery.form/3.51/jquery.form.min.js','footer') %}
        {% do assets.addJs('comment','/modules/comment/js/comment.js','footer') %}


        {{ view.r(regionRender('content_footer')) }}
    </div>
{% endblock %}

{% block right_box %}
        {{ view.r(regionRender('right')) }}
{% endblock %}

{% block bottom %}
    <script src="//cdn.bootcss.com/highlight.js/8.0/highlight.min.js"></script>
    <link href="//cdn.bootcss.com/highlight.js/8.0/styles/monokai_sublime.min.css" rel="stylesheet">
    <script src="/themes/itdashu/js/node.js"></script>
{% endblock %}
